using System.Web;
using System.Web.Routing;

namespace LogikBug.ModularMvc
{
	public static class ContextExtensions
	{
		public static ModularHttpContext GetModularHttpContext(this RequestContext context)
		{
			return context.HttpContext.GetModularHttpContext();
		}

		public static ModularHttpContext GetModularHttpContext(this HttpContextBase context)
		{
			return (context as ModularHttpContext) ?? ModularHttpContext.Create(HttpContext.Current);
		}
	}
}